package site.enjoyrun.mapper;

import org.apache.ibatis.annotations.*;
import site.enjoyrun.model.User;

import java.util.List;

@Mapper
public interface UserMapper {
    @Select("SELECT * FROM er_user")
    List<User> selectUsers();
    @Insert("INSERT INTO er_user(u_id,u_password,u_phone,u_school,u_keepid,u_joyrunid) VALUES('${uId}','${uPassword}','${uPhone}','${uSchool}','${uKeepid}','${uJoyrunid}')")
    int insertUser(User user);
    @Update("UPDATE er_user SET u_password='${uPassword}',u_phone='${uPhone}',u_school='${uSchool}',u_keepid='${uKeepid}',u_joyrunid='${uJoyrunid}' WHERE u_id='${uId}'")
    int updateUser(User user);
    @Delete("DELETE FROM er_user WHERE u_id='${uId}'")
    int deleteUser(String uId);
}
